function TripleStompDamage takes nothing returns nothing
	local unit target = GetEnumUnit()
	//--
	if IsUnitEnemy(target , udg_TempPlayer) and IsUnitInRangeLoc(target , udg_TempCasterLocation , udg_TempRadius) and GetUnitState(target , UNIT_STATE_LIFE) > 0.0 then
		call UnitDamageTarget(udg_TempCaster , target , udg_TempDamage , true , false , ATTACK_TYPE_NORMAL, DAMAGE_TYPE_COLD , WEAPON_TYPE_METAL_MEDIUM_BASH)
	endif
	//--
	set target = null
endfunction

function TripleStompDone takes nothing returns nothing
	local timer effectTimer = GetExpiredTimer()
	local integer timerId = GetHandleId(effectTimer)
	local unit dino = LoadUnitHandle(udg_HT , timerId , 3)
	local real angle = GetUnitFacing(dino) + 20.0
	local real dx = Cos(angle * bj_DEGTORAD) * 80.0
	local real dy = Sin(angle * bj_DEGTORAD) * 80.0
	//--
	set udg_TempCaster = dino
	set udg_TempPlayer = GetOwningPlayer(dino)
	set udg_TempDamage = 30.0
	set udg_TempRadius = 150.0
	set udg_TempCasterLocation = GetUnitLoc(dino)
	call MoveLocation(udg_TempCasterLocation , GetLocationX(udg_TempCasterLocation) + dx , GetLocationY(udg_TempCasterLocation) + dy)
	set bj_wantDestroyGroup = true
	call ForGroupBJ(GetUnitsInRangeOfLocMatching(udg_TempRadius+70.0, udg_TempCasterLocation , null) , function TripleStompDamage)
	call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" , GetLocationX(udg_TempCasterLocation) , GetLocationY(udg_TempCasterLocation)))
	call PauseTimer(effectTimer)
	call FlushChildHashtable(udg_HT , timerId)
	call DestroyTimer(effectTimer)
	call RemoveLocation(udg_TempCasterLocation)
	//--
	set effectTimer = null
	set dino = null
endfunction

function TripleStompStart takes nothing returns nothing
	local timer damageTimer = GetExpiredTimer()
	local integer timerId = GetHandleId(damageTimer)
	local unit dino = LoadUnitHandle(udg_HT , timerId , 3)
	local integer damageCounter = LoadInteger(udg_HT , timerId , 5)
	local timer effectTimer = null
	//--
	if damageCounter < LoadInteger(udg_HT , timerId , 4) then
		call SaveInteger(udg_HT , timerId , 5 , damageCounter + 1)
		call UnitPlayAnimation(dino , 5 , 1.15 , 0.35)
		set effectTimer = CreateTimer()
		call SaveUnitHandle(udg_HT , GetHandleId(effectTimer) , 3 , dino)
		call TimerStart(effectTimer , 0.03 , false , function TripleStompDone)
	else
		call PauseTimer(damageTimer)
		call FlushChildHashtable(udg_HT , timerId)
		call DestroyTimer(damageTimer)
		call SetUnitAnimationByIndex(dino , 1)
	endif
	//--
	set damageTimer = null
	set dino = null
	set effectTimer = null
endfunction

function Trig_TripleStomp_Actions takes nothing returns nothing
	local unit dino = GetTriggerUnit()
	local timer damageTimer = CreateTimer()
	local integer timerId = GetHandleId(damageTimer)
	//--
	call SaveUnitHandle(udg_HT , timerId , 3 , dino)
	call SaveInteger(udg_HT , timerId , 4 , 3)
	call SaveInteger(udg_HT , timerId , 5 , 0)
	call TimerStart(damageTimer , 0.6 , true , function TripleStompStart)
	//--
	set dino = null
	set damageTimer = null
endfunction

function Trig_TripleStomp_Conditions takes nothing returns boolean
	return GetSpellAbilityId() == 'A01C'
endfunction

function InitTrig_TripleStomp takes nothing returns nothing
	set gg_trg_TripleStomp = CreateTrigger()
	call TriggerRegisterAnyUnitEventBJ(gg_trg_TripleStomp , EVENT_PLAYER_UNIT_SPELL_EFFECT)
	call TriggerAddCondition(gg_trg_TripleStomp , Condition(function Trig_TripleStomp_Conditions))
	call TriggerAddAction(gg_trg_TripleStomp , function Trig_TripleStomp_Actions)
endfunction